package com.crm.dao.mapper.customMapper.followPlanManager;

import com.crm.model.entity.followPlanManager.CpFollowPlan;
import com.crm.model.qo.followPlanManager.CpFollowPlanQO;
import com.crm.model.vo.followPlanManager.CpFollowPlanVO;
import com.crm.model.vo.followPlanManager.FollowPlanContactListVO;
import com.crm.model.vo.followPlanManager.FollowPlanCountVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Author: chaifuyou
 * @date 2021/3/31 16:57
 */
public interface FollowPlanMapper {
    /**
     * 跟进计划列表
     * @return
     */
    List<CpFollowPlanVO> selectCustomerProductList(@Param("qo") CpFollowPlanQO cpFollowPlanQO, @Param("sortOrder") String sortOrder, @Param("dateUnit") Integer dateUnit, @Param("followUnit") Integer followUnit);

    /**
     * 添加跟进计划
     * @param cpFollowPlan
     */
    void insertSelective(CpFollowPlan cpFollowPlan);

    /**
     * 取消跟进计划
     * @param cpFollowPlanId
     * @return
     */
    void deleteFollowPlan(@Param("cpFollowPlanId") String cpFollowPlanId);

    /**
     * 取消跟进计划
     * @param cpFollowPlan
     * @return
     */
    void updateByPrimaryKeySelective(CpFollowPlan cpFollowPlan);

    /**
     * 统计日期的跟进情况
     * @param planDate
     * @return
     */
    List<Integer> getFollowPlanCount(@Param("planDate") String planDate,@Param("accountId") String accountId,@Param("startDate") String startDate,@Param("endDate") String endDate);

    /**
     * 当天跟进的客户列表
     * @param planDate
     * @param order
     * @param accountId
     * @return
     */
    List<FollowPlanContactListVO> getFollowPlanListByDate(@Param("planDate") String planDate, @Param("order")StringBuilder order, @Param("accountId")String accountId,@Param("dateUnit")Integer dateUnit);

    /**
     * 根据客户获取一个联系人信息，取热度值最高的
     * @param customerId
     * @return
     */
    FollowPlanContactListVO getOneContactInfoByCustomerId(@Param("customerId") String customerId);

    /**
     * 根据id查询跟进信息
     * @param cpFollowPlanId
     * @return
     */
    CpFollowPlanVO selectFollowPlanInfoById(@Param("cpFollowPlanId") String cpFollowPlanId);
}
